package com.ruoyi.process.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.process.mapper.WorkTakeoffhatMapper;
import com.ruoyi.process.domain.WorkTakeoffhat;
import com.ruoyi.process.service.IWorkTakeoffhatService;

/**
 * 脱帽管理Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class WorkTakeoffhatServiceImpl implements IWorkTakeoffhatService
{
    @Autowired
    private WorkTakeoffhatMapper workTakeoffhatMapper;
    @Override
    public List<WorkTakeoffhat> selectWorkTakeoffhatByuserId(Long userId)
    {
        return workTakeoffhatMapper.selectWorkTakeoffhatByuserId(userId);
    }
    /**
     * 查询脱帽管理
     *
     * @param workTakeoffhatId 脱帽管理ID
     * @return 脱帽管理
     */
    @Override
    public WorkTakeoffhat selectWorkTakeoffhatById(Long workTakeoffhatId)
    {
        return workTakeoffhatMapper.selectWorkTakeoffhatById(workTakeoffhatId);
    }

    /**
     * 查询脱帽管理列表
     *
     * @param workTakeoffhat 脱帽管理
     * @return 脱帽管理
     */
    @Override
    public List<WorkTakeoffhat> selectWorkTakeoffhatList(WorkTakeoffhat workTakeoffhat)
    {
        return workTakeoffhatMapper.selectWorkTakeoffhatList(workTakeoffhat);
    }

    /**
     * 新增脱帽管理
     *
     * @param workTakeoffhat 脱帽管理
     * @return 结果
     */
    @Override
    public int insertWorkTakeoffhat(WorkTakeoffhat workTakeoffhat)
    {
        workTakeoffhat.setCreateTime(DateUtils.getNowDate());
        return workTakeoffhatMapper.insertWorkTakeoffhat(workTakeoffhat);
    }

    /**
     * 修改脱帽管理
     *
     * @param workTakeoffhat 脱帽管理
     * @return 结果
     */
    @Override
    public int updateWorkTakeoffhat(WorkTakeoffhat workTakeoffhat)
    {
        workTakeoffhat.setUpdateTime(DateUtils.getNowDate());
        return workTakeoffhatMapper.updateWorkTakeoffhat(workTakeoffhat);
    }

    /**
     * 批量删除脱帽管理
     *
     * @param workTakeoffhatIds 需要删除的脱帽管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkTakeoffhatByIds(Long[] workTakeoffhatIds)
    {
        return workTakeoffhatMapper.deleteWorkTakeoffhatByIds(workTakeoffhatIds);
    }

    /**
     * 删除脱帽管理信息
     *
     * @param workTakeoffhatId 脱帽管理ID
     * @return 结果
     */
    @Override
    public int deleteWorkTakeoffhatById(Long workTakeoffhatId)
    {
        return workTakeoffhatMapper.deleteWorkTakeoffhatById(workTakeoffhatId);
    }
}
